<!--
 * @Author: 追逐的娃 kangchao_php@163.com
 * @Date: 2024-07-04 16:11:56
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-11-03 22:16:25
 * @FilePath: \vue-project\src\components\Preview\Index.vue
 * @Description: https://www.npmjs.com/package/@vue-office/excel
 * 
-->
<template>
  <a-card>
    <h2 class="mb-2">客服聊天功能</h2>
    <div class="w-sm flex justify-between">
      <a-link @click="openModal('doc')">相关文档</a-link>
      <a-link @click="openModal('function')">功能体验</a-link>
    </div>
  </a-card>
  <!-- 引入相关组件 -->
  <ChatModal ref="modalRef" :title="title" :openType="openType" />
</template>

<script setup>
import { ref } from 'vue'
import ChatModal from "./ChatModal.vue";


const modalRef = ref(null)
const title = ref('文档')
const openType = ref('doc')

const openModal = (type) => {
  if (type == 'doc') {
    title.value = '文档'
    openType.value = 'doc'
  } else {
    title.value = '功能体验'
    openType.value = 'function'
  }
  modalRef.value.open()
}

</script>

<style lang="scss" scoped></style>
